scsi: hisi_sas: Relocate some codes to avoid an unused check
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 9 Nov 2018 14:06:35 +0000 (22:06 +0800)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 18 Jul 2019 22:23:17 +0000 (23:23 +0100)
commitc60868abf859325387a89cf62366db721ad533dc
tree558beec063b50f8351bbb31d386e423c5cfc7852
parentafa77f9ec80932a9713a87d12b9e6095104d8b0d
scsi: hisi_sas: Relocate some codes to avoid an unused check

In function hisi_sas_task_prep(), we check asd_sas_port, but in function
hisi_sas_task_exec(), we already refer to asd_sas_port by using function
dev_to_hisi_hba() implicitly. So to avoid this possible invalid
dereference, relocate the check to function hisi_sas_task_prep().

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Gbp-Pq: Topic bugfix/arm64/huawei-taishan
Gbp-Pq: Name 0013-scsi-hisi_sas-Relocate-some-codes-to-avoid-an-unused.patch
drivers/scsi/hisi_sas/hisi_sas_main.c